#!/usr/bin/sh
# river/modes
# @author nate zhou
# @since 2025

# mod=Mod4
#
# fcitx="[p]inyin [a]nthy"
# wmenu="[w[w]iki w[h]eart w[b]ook [a]mount [f]locks [p]off w[s]ink w[j]doc w[e]moji"
# dunst="clip[h]ist-wipe [l]supdates d[w] w[c]al"
# wlrctl="[hjkl]cursors [,]left [.]right [m]iddle"
#
# # resize #######################################################################
# riverctl declare-mode resize
# riverctl map normal ${mod}+Control r enter-mode resize
#
# riverctl map resize ${mod}+Control  r       enter-mode normal
# riverctl map resize None            Escape  enter-mode normal
# riverctl map resize None            space   enter-mode normal
#
# riverctl map -repeat resize None f toggle-float
#
# riverctl map -repeat resize None h move left 50
# riverctl map -repeat resize None j move down 50
# riverctl map -repeat resize None k move up 50
# riverctl map -repeat resize None l move right 50
#
# riverctl map -repeat resize None y resize horizontal -50
# riverctl map -repeat resize None u resize vertical 50
# riverctl map -repeat resize None i resize vertical -50
# riverctl map -repeat resize None o resize horizontal 50
#
#
# # fcitx ########################################################################
# riverctl declare-mode "$fcitx"
# riverctl map normal ${mod}+Control f enter-mode "$fcitx"
#
# riverctl map "$fcitx" ${mod}+Control space enter-mode normal
# riverctl map "$fcitx" None Escape enter-mode normal
# riverctl map "$fcitx" None space enter-mode normal
#
# riverctl map "$fcitx" None p spawn "riverctl enter-mode normal && fcitx5-remote -s pinyin"
# riverctl map "$fcitx" None a spawn "riverctl enter-mode normal && fcitx5-remote -s anthy"
#
#
# # wmenu ########################################################################
# riverctl declare-mode "$wmenu"
# riverctl map normal $mod w enter-mode "$wmenu"
#
# riverctl map "$wmenu" $mod w      enter-mode normal
# riverctl map "$wmenu" None space  enter-mode normal
# riverctl map "$wmenu" None Escape enter-mode normal
#
# riverctl map "$wmenu" None w spawn "riverctl enter-mode normal && $HOME/.local/bin/wwiki"
# riverctl map "$wmenu" None h spawn "riverctl enter-mode normal && $HOME/.local/bin/wheart"
# riverctl map "$wmenu" None b spawn "riverctl enter-mode normal && $HOME/.local/bin/wbook"
# riverctl map "$wmenu" None a spawn "riverctl enter-mode normal && $HOME/.local/bin/amount"
# riverctl map "$wmenu" None f spawn "riverctl enter-mode normal && $HOME/.local/bin/flocks"
# riverctl map "$wmenu" None p spawn "riverctl enter-mode normal && $HOME/.local/bin/poff"
# riverctl map "$wmenu" None s spawn "riverctl enter-mode normal && $HOME/.local/bin/wsink"
# riverctl map "$wmenu" None j spawn "riverctl enter-mode normal && $HOME/.local/bin/wjdoc"
# riverctl map "$wmenu" None e spawn "riverctl enter-mode normal && $HOME/.local/bin/wemoji"
#
#
# # dunst ########################################################################
# riverctl declare-mode "$dunst"
# riverctl map normal $mod z enter-mode "$dunst"
#
# riverctl map "$dunst" $mod z enter-mode normal
# riverctl map "$dunst" $mod apostrophe enter-mode normal
# riverctl map "$dunst" None space enter-mode normal
# riverctl map "$dunst" None Escape enter-mode normal
#
# riverctl map "$dunst" None h spawn "riverctl enter-mode normal && cliphist wipe"
# riverctl map "$dunst" None l spawn "riverctl enter-mode normal && $HOME/.local/bin/lsupdates"
# riverctl map "$dunst" None w spawn "riverctl enter-mode normal && $HOME/.local/bin/dw"
# riverctl map "$dunst" None c spawn "riverctl enter-mode normal && $HOME/.local/bin/wcal"
#
#
# # wlrctl #######################################################################
# riverctl declare-mode "$wlrctl"
# riverctl map normal $mod slash enter-mode "$wlrctl"
#
# riverctl map "$wlrctl" $mod slash enter-mode normal
# riverctl map "$wlrctl" None space     enter-mode normal
# riverctl map "$wlrctl" None Escape    enter-mode normal
#
# riverctl map -repeat "$wlrctl" None  h spawn "wlrctl pointer move -90 0"
# riverctl map -repeat "$wlrctl" None  j spawn "wlrctl pointer move 0 90"
# riverctl map -repeat "$wlrctl" None  k spawn "wlrctl pointer move 0 -90"
# riverctl map -repeat "$wlrctl" None  l spawn "wlrctl pointer move 90 0"
# riverctl map -repeat "$wlrctl" Shift h spawn "wlrctl pointer move -15 0"
# riverctl map -repeat "$wlrctl" Shift j spawn "wlrctl pointer move 0 15"
# riverctl map -repeat "$wlrctl" Shift k spawn "wlrctl pointer move 0 -15"
# riverctl map -repeat "$wlrctl" Shift l spawn "wlrctl pointer move 15 0"
#
# riverctl map -repeat "$wlrctl" None  comma  spawn "wlrctl pointer click left"
# riverctl map -repeat "$wlrctl" None  period spawn "wlrctl pointer click right"
# riverctl map -repeat "$wlrctl" Shift comma  spawn "wlrctl pointer click left"
# riverctl map -repeat "$wlrctl" Shift period spawn "wlrctl pointer click right"
#
# riverctl map -repeat "$wlrctl" None n spawn "wlrctl pointer scroll 30"
# riverctl map -repeat "$wlrctl" None p spawn "wlrctl pointer scroll -30"
